package com.taotao.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.taotao.common.resp.TaotaoResult;
import com.taotao.pojo.Content;
import com.taotao.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by zzb on 2017/11/9.
 */
@Controller
@RequestMapping("/content")
public class ContentController {


    @Reference
    private ContentService contentService;

    //url：/content/save
    //参数：表单的数据。使用pojo接收TbContent
    //返回值：TaotaoResult（json数据）
    //content save
    @RequestMapping("/save")
    @ResponseBody
    public TaotaoResult save(Content content) {

        TaotaoResult taotaoResult = contentService.save(content);
        return taotaoResult;
    }
}
